﻿using NetworkLib.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PBO.Network.Domain
{
    public class BattleInfo : DataByteArray
    {
        public BattleTerrain Terrain { get; set; }
        public BattleMode Mode { get; set; }
        public string Caption { get; set; }
        public string CustomDataHash { get; set; }

        #region abstract

        public override void Read(ByteArray byteArray)
        {
            this.Terrain = (BattleTerrain)byteArray.ReadInt();
            this.Mode = (BattleMode)byteArray.ReadInt();
            this.Caption = byteArray.ReadUTF();
            this.CustomDataHash = byteArray.ReadUTF();
        }

        public override void Write(ByteArray byteArray)
        {
            byteArray.WriteInt((int)this.Terrain);
            byteArray.WriteInt((int)this.Mode);
            byteArray.WriteUTF(this.Caption);
            byteArray.WriteUTF(this.CustomDataHash);
        }

        #endregion
    }
}
